import request from '@/utils/request';

/**
 * 积分明细列表
 * @param params 查询条件
 */
export async function pointsDetailsList(params) {
  const res = await request.get('/massage/integralDetailRecords/page', {
    params
  });

  if (res.data.code === 200) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}

/**
 * 站点列表删除
 * @param params 查询条件
 */

export async function pointsDetailsDelete(id) {
  const res = await request.delete('/massage/integralDetailRecords/' + id);
  console.log(res);
  if (res.data.code === 200) {
    return res.data.message;
  }
  return Promise.reject(new Error(res.data.message));
}

export async function pointsDetailsBatch(data) {
  const res = await request.delete('/massage/integralDetailRecords/batch', {
    data
  });
  if (res.data.code === 200) {
    return res.data.message;
  }
  return Promise.reject(new Error(res.data.message));
}
